﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DBConn;
using Llama;

namespace snecFunctions
{
    public class snecFunctions
    {
        PIDDBConn _pidDBConn;
        public snecFunctions(PIDDBConn pidDBConn)
        {
            _pidDBConn = pidDBConn;
        }

        /// <summary>
        /// 查找所有多余的断点
        /// </summary>
        public void FindRedundantBreak(LMDrawings dwgObjs)
        {
            var sql = "";
            foreach (LMDrawing objDrawing in dwgObjs)
            {
                sql = $@"SELECT T.SP_ID,tagsequenceno,fluidsystem
FROM xxxSchemaName.t_piperun t
join xxxSchemaName.t_modelitem t2 on t2.sp_id = t.sp_id
join xxxSchemaName.t_plantitem t3 on t3.sp_id = t.sp_id
join xxxSchemaName.t_representation t4 on t4.sp_modelitemid = t.sp_id
join xxxSchemaName.t_drawing t5 on t5.sp_id = t4.sp_drawingid where t5.name = '{objDrawing.Name}' and t4.representationtype = '13'
order by tagsequenceno,fluidsystem
"
                MyPIDConn.PIDReadDataByDBA(MyPIDConn.PIDPlant_DBNAME, MyPIDConn.ActivePlantPIDApp_User, sql, dtRuns) '感觉后面这些属性值完全没有用

            }
        }
    }
}
